﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using AssetManageSystem.Model.OrgManage;


namespace AssetManageSystem.ViewModel.OrgManage.UserVMs
{
    public partial class UserTemplateVM : BaseTemplateVM
    {
        [Display(Name = "姓名")]
        public ExcelPropety UserName_Excel = ExcelPropety.CreateProperty<User>(x => x.UserName);
        [Display(Name = "性别")]
        public ExcelPropety UserSex_Excel = ExcelPropety.CreateProperty<User>(x => x.UserSex);
        [Display(Name = "生日")]
        public ExcelPropety UserBirthday_Excel = ExcelPropety.CreateProperty<User>(x => x.UserBirthday);
        [Display(Name = "地址")]
        public ExcelPropety UserAddress_Excel = ExcelPropety.CreateProperty<User>(x => x.UserAddress);
        [Display(Name = "电话号码")]
        public ExcelPropety UserPhone_Excel = ExcelPropety.CreateProperty<User>(x => x.UserPhone);
        [Display(Name = "邮箱")]
        public ExcelPropety UserEmail_Excel = ExcelPropety.CreateProperty<User>(x => x.UserEmail);
        [Display(Name = "部门")]
        public ExcelPropety UserDep_Excel = ExcelPropety.CreateProperty<User>(x => x.UserDepId);

	    protected override void InitVM()
        {
            UserDep_Excel.DataType = ColumnDataType.ComboBox;
            UserDep_Excel.ListItems = DC.Set<Department>().GetSelectListItems(Wtm, y => y.DepName);
        }

    }

    public class UserImportVM : BaseImportVM<UserTemplateVM, User>
    {

    }

}
